package com.project.internship.controller.info;

import com.project.internship.entity.resp.RespBean;
import com.project.internship.service.TeacherService;
import com.project.internship.vo.TeacherDeptVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/information/teacherSelf")
public class InfoTeacherSelfController {

    @Autowired
    TeacherService teacherService;

    @GetMapping("/")
    public List<TeacherDeptVO> getTeacherSelfInfo() {
        return teacherService.getTeacherSelfInfo();
    }

    @PutMapping("/")
    public RespBean updateTeacherSelfInfo(@RequestBody TeacherDeptVO teacherDeptVO) {
        if(teacherService.updateTeacherSelfInfo(teacherDeptVO) == 1) {
            return RespBean.ok("修改成功！");
        }
        return RespBean.error("修改失败！");
    }

}
